﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model;
using BLL;

namespace GeniusWebApplication
{
    public partial class message : System.Web.UI.Page
    {
        public User user = null;
        public string words;
        protected void Page_Load(object sender, EventArgs e)
        {
            user = (User)HttpContext.Current.Session["user"];
            if (user == null)
                Response.Redirect("log.aspx");

        }

        NoticeService ns = new NoticeService();

        protected void Check_MyMessage(object sender, EventArgs e)
        {

            IList<Notice> messages = ns.getUserAllNotice(user.id);

            rpt_Message.DataSource = messages;

            rpt_Message.DataBind();
        
        }

        protected void Check_UnReadMessage(object sender, EventArgs e)
        {
            IList<Notice> messages = ns.getUserNotReadNotice(user.id);
            rpt_Message.DataSource = messages;
            rpt_Message.DataBind();
        }

    }
}